using System;
using Holoville.HOTween;
using UnityEngine;

public class AnimateScaleUpAndDown : MonoBehaviour
{
	private void Awake()
	{
		this.orgScale = base.transform.localScale;
	}

	private void OnEnable()
	{
		if (this.seq != null)
		{
			this.seq.Kill();
		}
		base.transform.localScale = this.orgScale;
		this.ScaleUpAndDown();
	}

	private void OnDisable()
	{
		if (this.seq != null)
		{
			this.seq.Kill();
		}
	}

	private void ScaleUpAndDown()
	{
		this.seq = new Sequence(new SequenceParms().Loops(-1, LoopType.Restart));
		this.seq.Insert(0f, HOTween.To(base.transform, this.duration, new TweenParms().Prop("localScale", this.upScale).Ease(EaseType.EaseOutQuad)));
		this.seq.Insert(this.duration, HOTween.To(base.transform, this.duration, new TweenParms().Prop("localScale", this.orgScale).Ease(EaseType.EaseOutQuad)));
		this.seq.Play();
	}

	public Vector3 upScale = new Vector3(1.1f, 1.1f, 1f);

	public float duration = 0.45f;

	private Sequence seq;

	private Vector3 orgScale;
}
